package cn.itcast.bos.dao.base;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.base.Standard;

public interface StandardRepository extends JpaRepository<Standard,Integer> {
	
	//基于一列的规则查询，根据收派标准的Name查询
	public List<Standard> findByName(String Name);
	
	//基于两列的查询
	public List<Standard> findByNameAndMaxLength(String Name,Integer MaxLength);
	
	//模糊查询
	public List<Standard> findByNameLike(String Name);
	
	
	//不准收规则
	@Query(value="from Standard where name=?",nativeQuery=false)
	public List<Standard>  queryName(String Name);
	
	
	//修改
	@Query(value="update Standard set minLength=?2 where id=?1")
	@Modifying
	public void updateMinLength(Integer id,Integer minLInteger);
	
	//删除操作
	//修改
	@Query(value="delete Standard where id=?")
	@Modifying
	public void deleteById(Integer id);

	//作废收派标准
	@Query(value="update Standard set deltag=? where id=?")
	@Modifying
	public void updataDeltag(Character log,int parseInt);

	
}
